using UnityEngine;

namespace Light
{
    public class CoreComp<T> where T : CoreComponent
    {
        private readonly Core core;
        private T comp;

        public CoreComp(Core core)
        {
            if (core == null) Debug.LogWarning($"core is component{typeof(T)}");
            this.core = core;
        }

        public T Comp => comp ? comp : core.GetCoreComponent<T>();
    }
}